package com.foreknow.oop.hw6;

/**
 * 汽车类
 */
public class Vehicle {
    private String brand;   // 品牌
    private String color;   // 颜色
    private double speed;   // 速度

    public Vehicle() {
    }

    public Vehicle(String brand, String color) {
        this.brand = brand;
        this.color = color;
        this.speed = 0.0f;
    }

    public String getBrand() {
        return brand;
    }

    public String getColor() {
        return color;
    }

    public void setColor(String color) {
        this.color = color;
    }

    public double getSpeed() {
        return speed;
    }

    public void setSpeed(double speed) {
        this.speed = speed;
    }

    /**
     * 汽车启动
     */
    public void run(){
        System.out.printf("%s品牌%s色的汽车以%.2f米每秒的速度向前行驶\n",brand,color,speed);
    }
}
